package org.jivesoftware.smackx.muc;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ChatManager;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.ConnectionCreationListener;
import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.PacketInterceptor;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.filter.AndFilter;
import org.jivesoftware.smack.filter.FromMatchesFilter;
import org.jivesoftware.smack.filter.MessageTypeFilter;
import org.jivesoftware.smack.filter.PacketExtensionFilter;
import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.filter.PacketIDFilter;
import org.jivesoftware.smack.filter.PacketTypeFilter;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.IQ.Type;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Message.Type;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Presence.Mode;
import org.jivesoftware.smack.packet.Presence.Type;
import org.jivesoftware.smack.packet.Registration;
import org.jivesoftware.smackx.Form;
import org.jivesoftware.smackx.NodeInformationProvider;
import org.jivesoftware.smackx.ServiceDiscoveryManager;
import org.jivesoftware.smackx.packet.DiscoverInfo;
import org.jivesoftware.smackx.packet.DiscoverInfo.Identity;
import org.jivesoftware.smackx.packet.DiscoverItems;
import org.jivesoftware.smackx.packet.DiscoverItems.Item;
import org.jivesoftware.smackx.packet.MUCAdmin;
import org.jivesoftware.smackx.packet.MUCAdmin.Item;
import org.jivesoftware.smackx.packet.MUCInitialPresence;
import org.jivesoftware.smackx.packet.MUCOwner;
import org.jivesoftware.smackx.packet.MUCOwner.Destroy;
import org.jivesoftware.smackx.packet.MUCOwner.Item;
import org.jivesoftware.smackx.packet.MUCUser;
import org.jivesoftware.smackx.packet.MUCUser.Decline;
import org.jivesoftware.smackx.packet.MUCUser.Invite;
import org.jivesoftware.smackx.packet.MUCUser.Item;
import org.jivesoftware.smackx.packet.MUCUser.Status;

public class MultiUserChat
{
  private static final String discoNamespace = "http://jabber.org/protocol/muc";
  private static final String discoNode = "http://jabber.org/protocol/muc#rooms";
  private static Map<Connection, List<String>> joinedRooms = new WeakHashMap();
  private Connection connection;
  private List<PacketListener> connectionListeners;
  private final List<InvitationRejectionListener> invitationRejectionListeners;
  private boolean joined;
  private ConnectionDetachedPacketCollector messageCollector;
  private PacketFilter messageFilter;
  private String nickname = null;
  private Map<String, Presence> occupantsMap;
  private final List<ParticipantStatusListener> participantStatusListeners;
  private PacketFilter presenceFilter;
  private List<PacketInterceptor> presenceInterceptors;
  private String room;
  private RoomListenerMultiplexor roomListenerMultiplexor;
  private String subject;
  private final List<SubjectUpdatedListener> subjectUpdatedListeners;
  private final List<UserStatusListener> userStatusListeners;

  static
  {
    Connection.addConnectionCreationListener(new ConnectionCreationListener()
    {
      public void connectionCreated()
      {
        ServiceDiscoveryManager.getInstanceFor(paramConnection).addFeature("http://jabber.org/protocol/muc");
        ServiceDiscoveryManager.getInstanceFor(paramConnection).setNodeInformationProvider("http://jabber.org/protocol/muc#rooms", new NodeInformationProvider(this, paramConnection)
        {
          public List<String> getNodeFeatures()
          {
            return null;
          }

          public List<DiscoverInfo.Identity> getNodeIdentities()
          {
            return null;
          }

          public List<DiscoverItems.Item> getNodeItems()
          {
            ArrayList localArrayList = new ArrayList();
            Iterator localIterator = MultiUserChat.access$0(this.val$connection);
            while (true)
            {
              if (!(localIterator.hasNext()))
                return localArrayList;
              localArrayList.add(new DiscoverItems.Item((String)localIterator.next()));
            }
          }
        });
      }
    });
  }

  public MultiUserChat(Connection paramConnection, String paramString)
  {
    this.joined = false;
    this.occupantsMap = new ConcurrentHashMap();
    this.invitationRejectionListeners = new ArrayList();
    this.subjectUpdatedListeners = new ArrayList();
    this.userStatusListeners = new ArrayList();
    this.participantStatusListeners = new ArrayList();
    this.presenceInterceptors = new ArrayList();
    this.connectionListeners = new ArrayList();
    this.connection = paramConnection;
    this.room = paramString.toLowerCase();
    init();
  }

  public static void addInvitationListener(Connection paramConnection, InvitationListener paramInvitationListener)
  {
    InvitationsMonitor.getInvitationsMonitor(paramConnection).addInvitationListener(paramInvitationListener);
  }

  private void changeAffiliationByAdmin(String paramString1, String paramString2, String paramString3)
    throws XMPPException
  {
    MUCAdmin localMUCAdmin = new MUCAdmin();
    localMUCAdmin.setTo(this.room);
    localMUCAdmin.setType(IQ.Type.SET);
    MUCAdmin.Item localItem = new MUCAdmin.Item(paramString2, null);
    localItem.setJid(paramString1);
    localItem.setReason(paramString3);
    localMUCAdmin.addItem(localItem);
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCAdmin.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCAdmin);
    IQ localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from server.");
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
  }

  private void changeAffiliationByAdmin(Collection<String> paramCollection, String paramString)
    throws XMPPException
  {
    IQ localIQ;
    MUCAdmin localMUCAdmin = new MUCAdmin();
    localMUCAdmin.setTo(this.room);
    localMUCAdmin.setType(IQ.Type.SET);
    Iterator localIterator = paramCollection.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCAdmin.getPacketID());
        PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
        this.connection.sendPacket(localMUCAdmin);
        localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        localPacketCollector.cancel();
        if (localIQ != null)
          break;
        throw new XMPPException("No response from server.");
      }
      String str = (String)localIterator.next();
      MUCAdmin.Item localItem = new MUCAdmin.Item(paramString, null);
      localItem.setJid(str);
      localMUCAdmin.addItem(localItem);
    }
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
  }

  private void changeAffiliationByOwner(String paramString1, String paramString2)
    throws XMPPException
  {
    MUCOwner localMUCOwner = new MUCOwner();
    localMUCOwner.setTo(this.room);
    localMUCOwner.setType(IQ.Type.SET);
    MUCOwner.Item localItem = new MUCOwner.Item(paramString2);
    localItem.setJid(paramString1);
    localMUCOwner.addItem(localItem);
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCOwner.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCOwner);
    IQ localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from server.");
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
  }

  private void changeAffiliationByOwner(Collection<String> paramCollection, String paramString)
    throws XMPPException
  {
    IQ localIQ;
    MUCOwner localMUCOwner = new MUCOwner();
    localMUCOwner.setTo(this.room);
    localMUCOwner.setType(IQ.Type.SET);
    Iterator localIterator = paramCollection.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCOwner.getPacketID());
        PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
        this.connection.sendPacket(localMUCOwner);
        localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        localPacketCollector.cancel();
        if (localIQ != null)
          break;
        throw new XMPPException("No response from server.");
      }
      String str = (String)localIterator.next();
      MUCOwner.Item localItem = new MUCOwner.Item(paramString);
      localItem.setJid(str);
      localMUCOwner.addItem(localItem);
    }
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
  }

  private void changeRole(String paramString1, String paramString2, String paramString3)
    throws XMPPException
  {
    MUCAdmin localMUCAdmin = new MUCAdmin();
    localMUCAdmin.setTo(this.room);
    localMUCAdmin.setType(IQ.Type.SET);
    MUCAdmin.Item localItem = new MUCAdmin.Item(null, paramString2);
    localItem.setNick(paramString1);
    localItem.setReason(paramString3);
    localMUCAdmin.addItem(localItem);
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCAdmin.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCAdmin);
    IQ localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from server.");
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
  }

  private void changeRole(Collection<String> paramCollection, String paramString)
    throws XMPPException
  {
    IQ localIQ;
    MUCAdmin localMUCAdmin = new MUCAdmin();
    localMUCAdmin.setTo(this.room);
    localMUCAdmin.setType(IQ.Type.SET);
    Iterator localIterator = paramCollection.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCAdmin.getPacketID());
        PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
        this.connection.sendPacket(localMUCAdmin);
        localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        localPacketCollector.cancel();
        if (localIQ != null)
          break;
        throw new XMPPException("No response from server.");
      }
      String str = (String)localIterator.next();
      MUCAdmin.Item localItem = new MUCAdmin.Item(null, paramString);
      localItem.setNick(str);
      localMUCAdmin.addItem(localItem);
    }
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
  }

  private void checkAffiliationModifications(String paramString1, String paramString2, boolean paramBoolean, String paramString3)
  {
    if (("owner".equals(paramString1)) && (!("owner".equals(paramString2))))
      if (paramBoolean)
      {
        fireUserStatusListeners("ownershipRevoked", new Object[0]);
        if (("owner".equals(paramString1)) || (!("owner".equals(paramString2))))
          break label271;
        if (!(paramBoolean))
          break label240;
        fireUserStatusListeners("ownershipGranted", new Object[0]);
      }
    while (true)
    {
      while (true)
      {
        label171: label340: 
        do
          while (true)
          {
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  while (true)
                  {
                    do
                      while (true)
                      {
                        while (true)
                        {
                          while (true)
                          {
                            return;
                            ArrayList localArrayList6 = new ArrayList();
                            localArrayList6.add(paramString3);
                            fireParticipantStatusListeners("ownershipRevoked", localArrayList6);
                          }
                          if ((!("admin".equals(paramString1))) || ("admin".equals(paramString2)))
                            break label171;
                          if (!(paramBoolean))
                            break;
                          fireUserStatusListeners("adminRevoked", new Object[0]);
                        }
                        ArrayList localArrayList5 = new ArrayList();
                        localArrayList5.add(paramString3);
                        fireParticipantStatusListeners("adminRevoked", localArrayList5);
                      }
                    while ((!("member".equals(paramString1))) || ("member".equals(paramString2)));
                    if (!(paramBoolean))
                      break;
                    fireUserStatusListeners("membershipRevoked", new Object[0]);
                  }
                  ArrayList localArrayList1 = new ArrayList();
                  localArrayList1.add(paramString3);
                  fireParticipantStatusListeners("membershipRevoked", localArrayList1);
                }
                label240: ArrayList localArrayList4 = new ArrayList();
                localArrayList4.add(paramString3);
                fireParticipantStatusListeners("ownershipGranted", localArrayList4);
              }
              if (("admin".equals(paramString1)) || (!("admin".equals(paramString2))))
                break label340;
              if (!(paramBoolean))
                break;
              fireUserStatusListeners("adminGranted", new Object[0]);
            }
            ArrayList localArrayList3 = new ArrayList();
            localArrayList3.add(paramString3);
            fireParticipantStatusListeners("adminGranted", localArrayList3);
          }
        while (("member".equals(paramString1)) || (!("member".equals(paramString2))));
        label271: if (!(paramBoolean))
          break;
        fireUserStatusListeners("membershipGranted", new Object[0]);
      }
      ArrayList localArrayList2 = new ArrayList();
      localArrayList2.add(paramString3);
      fireParticipantStatusListeners("membershipGranted", localArrayList2);
    }
  }

  private void checkPresenceCode(String paramString1, boolean paramBoolean, MUCUser paramMUCUser, String paramString2)
  {
    if ("307".equals(paramString1))
      if (paramBoolean)
      {
        this.joined = false;
        Object[] arrayOfObject2 = new Object[2];
        arrayOfObject2[0] = paramMUCUser.getItem().getActor();
        arrayOfObject2[1] = paramMUCUser.getItem().getReason();
        fireUserStatusListeners("kicked", arrayOfObject2);
        this.occupantsMap.clear();
        this.nickname = null;
        userHasLeft();
      }
    while (true)
    {
      label274: label325: 
      do
        while (true)
        {
          do
          {
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  return;
                  ArrayList localArrayList3 = new ArrayList();
                  localArrayList3.add(paramString2);
                  localArrayList3.add(paramMUCUser.getItem().getActor());
                  localArrayList3.add(paramMUCUser.getItem().getReason());
                  fireParticipantStatusListeners("kicked", localArrayList3);
                }
                if (!("301".equals(paramString1)))
                  break label274;
                if (!(paramBoolean))
                  break;
                this.joined = false;
                Object[] arrayOfObject1 = new Object[2];
                arrayOfObject1[0] = paramMUCUser.getItem().getActor();
                arrayOfObject1[1] = paramMUCUser.getItem().getReason();
                fireUserStatusListeners("banned", arrayOfObject1);
                this.occupantsMap.clear();
                this.nickname = null;
                userHasLeft();
              }
              ArrayList localArrayList2 = new ArrayList();
              localArrayList2.add(paramString2);
              localArrayList2.add(paramMUCUser.getItem().getActor());
              localArrayList2.add(paramMUCUser.getItem().getReason());
              fireParticipantStatusListeners("banned", localArrayList2);
            }
            if (!("321".equals(paramString1)))
              break label325;
          }
          while (!(paramBoolean));
          this.joined = false;
          fireUserStatusListeners("membershipRevoked", new Object[0]);
          this.occupantsMap.clear();
          this.nickname = null;
          userHasLeft();
        }
      while (!("303".equals(paramString1)));
      ArrayList localArrayList1 = new ArrayList();
      localArrayList1.add(paramString2);
      localArrayList1.add(paramMUCUser.getItem().getNick());
      fireParticipantStatusListeners("nicknameChanged", localArrayList1);
    }
  }

  private void checkRoleModifications(String paramString1, String paramString2, boolean paramBoolean, String paramString3)
  {
    if (((("visitor".equals(paramString1)) || ("none".equals(paramString1)))) && ("participant".equals(paramString2)))
      if (paramBoolean)
      {
        fireUserStatusListeners("voiceGranted", new Object[0]);
        if (("moderator".equals(paramString1)) || (!("moderator".equals(paramString2))))
          break label288;
        if (("visitor".equals(paramString1)) || ("none".equals(paramString1)))
        {
          if (!(paramBoolean))
            break label226;
          fireUserStatusListeners("voiceGranted", new Object[0]);
        }
        if (!(paramBoolean))
          break label257;
        fireUserStatusListeners("moderatorGranted", new Object[0]);
      }
    while (true)
    {
      label257: label288: 
      do
        while (true)
        {
          while (true)
          {
            while (true)
            {
              while (true)
              {
                do
                  while (true)
                  {
                    return;
                    ArrayList localArrayList6 = new ArrayList();
                    localArrayList6.add(paramString3);
                    fireParticipantStatusListeners("voiceGranted", localArrayList6);
                  }
                while ((!("participant".equals(paramString1))) || ((!("visitor".equals(paramString2))) && (!("none".equals(paramString2)))));
                if (!(paramBoolean))
                  break;
                fireUserStatusListeners("voiceRevoked", new Object[0]);
              }
              ArrayList localArrayList1 = new ArrayList();
              localArrayList1.add(paramString3);
              fireParticipantStatusListeners("voiceRevoked", localArrayList1);
            }
            label226: ArrayList localArrayList4 = new ArrayList();
            localArrayList4.add(paramString3);
            fireParticipantStatusListeners("voiceGranted", localArrayList4);
          }
          ArrayList localArrayList5 = new ArrayList();
          localArrayList5.add(paramString3);
          fireParticipantStatusListeners("moderatorGranted", localArrayList5);
        }
      while ((!("moderator".equals(paramString1))) || ("moderator".equals(paramString2)));
      if (("visitor".equals(paramString2)) || ("none".equals(paramString2)))
      {
        if (!(paramBoolean))
          break label361;
        fireUserStatusListeners("voiceRevoked", new Object[0]);
      }
      while (true)
      {
        while (true)
        {
          if (!(paramBoolean))
            break label392;
          fireUserStatusListeners("moderatorRevoked", new Object[0]);
        }
        label361: ArrayList localArrayList2 = new ArrayList();
        localArrayList2.add(paramString3);
        fireParticipantStatusListeners("voiceRevoked", localArrayList2);
      }
      label392: ArrayList localArrayList3 = new ArrayList();
      localArrayList3.add(paramString3);
      fireParticipantStatusListeners("moderatorRevoked", localArrayList3);
    }
  }

  public static void decline(Connection paramConnection, String paramString1, String paramString2, String paramString3)
  {
    Message localMessage = new Message(paramString1);
    MUCUser localMUCUser = new MUCUser();
    MUCUser.Decline localDecline = new MUCUser.Decline();
    localDecline.setTo(paramString2);
    localDecline.setReason(paramString3);
    localMUCUser.setDecline(localDecline);
    localMessage.addExtension(localMUCUser);
    paramConnection.sendPacket(localMessage);
  }

  // ERROR //
  private void fireInvitationRejectionListeners(String paramString1, String paramString2)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 90	org/jivesoftware/smackx/muc/MultiUserChat:invitationRejectionListeners	Ljava/util/List;
    //   4: astore_3
    //   5: aload_3
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 90	org/jivesoftware/smackx/muc/MultiUserChat:invitationRejectionListeners	Ljava/util/List;
    //   11: invokeinterface 394 1 0
    //   16: anewarray 396	org/jivesoftware/smackx/muc/InvitationRejectionListener
    //   19: astore 5
    //   21: aload_0
    //   22: getfield 90	org/jivesoftware/smackx/muc/MultiUserChat:invitationRejectionListeners	Ljava/util/List;
    //   25: aload 5
    //   27: invokeinterface 400 2 0
    //   32: pop
    //   33: aload_3
    //   34: monitorexit
    //   35: aload 5
    //   37: arraylength
    //   38: istore 7
    //   40: iconst_0
    //   41: istore 8
    //   43: iload 8
    //   45: iload 7
    //   47: if_icmplt +11 -> 58
    //   50: return
    //   51: astore 4
    //   53: aload_3
    //   54: monitorexit
    //   55: aload 4
    //   57: athrow
    //   58: aload 5
    //   60: iload 8
    //   62: aaload
    //   63: aload_1
    //   64: aload_2
    //   65: invokeinterface 403 3 0
    //   70: iinc 8 1
    //   73: goto -30 -> 43
    //
    // Exception table:
    //   from	to	target	type
    //   7	35	51	finally
    //   53	55	51	finally
  }

  // ERROR //
  private void fireParticipantStatusListeners(String paramString, List<String> paramList)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 96	org/jivesoftware/smackx/muc/MultiUserChat:participantStatusListeners	Ljava/util/List;
    //   4: astore_3
    //   5: aload_3
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 96	org/jivesoftware/smackx/muc/MultiUserChat:participantStatusListeners	Ljava/util/List;
    //   11: invokeinterface 394 1 0
    //   16: anewarray 411	org/jivesoftware/smackx/muc/ParticipantStatusListener
    //   19: astore 5
    //   21: aload_0
    //   22: getfield 96	org/jivesoftware/smackx/muc/MultiUserChat:participantStatusListeners	Ljava/util/List;
    //   25: aload 5
    //   27: invokeinterface 400 2 0
    //   32: pop
    //   33: aload_3
    //   34: monitorexit
    //   35: aload_2
    //   36: invokeinterface 394 1 0
    //   41: anewarray 413	java/lang/Class
    //   44: astore 10
    //   46: iconst_0
    //   47: istore 11
    //   49: iload 11
    //   51: aload_2
    //   52: invokeinterface 394 1 0
    //   57: if_icmplt +37 -> 94
    //   60: ldc_w 411
    //   63: aload_1
    //   64: aload 10
    //   66: invokevirtual 417	java/lang/Class:getDeclaredMethod	(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
    //   69: astore 12
    //   71: aload 5
    //   73: arraylength
    //   74: istore 13
    //   76: iconst_0
    //   77: istore 14
    //   79: iload 14
    //   81: iload 13
    //   83: if_icmplt +24 -> 107
    //   86: return
    //   87: astore 4
    //   89: aload_3
    //   90: monitorexit
    //   91: aload 4
    //   93: athrow
    //   94: aload 10
    //   96: iload 11
    //   98: ldc 104
    //   100: aastore
    //   101: iinc 11 1
    //   104: goto -55 -> 49
    //   107: aload 12
    //   109: aload 5
    //   111: iload 14
    //   113: aaload
    //   114: aload_2
    //   115: invokeinterface 420 1 0
    //   120: invokevirtual 426	java/lang/reflect/Method:invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    //   123: pop
    //   124: iinc 14 1
    //   127: goto -48 -> 79
    //   130: astore 9
    //   132: aload 9
    //   134: invokevirtual 429	java/lang/NoSuchMethodException:printStackTrace	()V
    //   137: goto -51 -> 86
    //   140: astore 8
    //   142: aload 8
    //   144: invokevirtual 430	java/lang/reflect/InvocationTargetException:printStackTrace	()V
    //   147: goto -61 -> 86
    //   150: astore 7
    //   152: aload 7
    //   154: invokevirtual 431	java/lang/IllegalAccessException:printStackTrace	()V
    //   157: goto -71 -> 86
    //
    // Exception table:
    //   from	to	target	type
    //   7	35	87	finally
    //   89	91	87	finally
    //   35	76	130	java/lang/NoSuchMethodException
    //   94	124	130	java/lang/NoSuchMethodException
    //   35	76	140	java/lang/reflect/InvocationTargetException
    //   94	124	140	java/lang/reflect/InvocationTargetException
    //   35	76	150	java/lang/IllegalAccessException
    //   94	124	150	java/lang/IllegalAccessException
  }

  // ERROR //
  private void fireSubjectUpdatedListeners(String paramString1, String paramString2)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 92	org/jivesoftware/smackx/muc/MultiUserChat:subjectUpdatedListeners	Ljava/util/List;
    //   4: astore_3
    //   5: aload_3
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 92	org/jivesoftware/smackx/muc/MultiUserChat:subjectUpdatedListeners	Ljava/util/List;
    //   11: invokeinterface 394 1 0
    //   16: anewarray 433	org/jivesoftware/smackx/muc/SubjectUpdatedListener
    //   19: astore 5
    //   21: aload_0
    //   22: getfield 92	org/jivesoftware/smackx/muc/MultiUserChat:subjectUpdatedListeners	Ljava/util/List;
    //   25: aload 5
    //   27: invokeinterface 400 2 0
    //   32: pop
    //   33: aload_3
    //   34: monitorexit
    //   35: aload 5
    //   37: arraylength
    //   38: istore 7
    //   40: iconst_0
    //   41: istore 8
    //   43: iload 8
    //   45: iload 7
    //   47: if_icmplt +11 -> 58
    //   50: return
    //   51: astore 4
    //   53: aload_3
    //   54: monitorexit
    //   55: aload 4
    //   57: athrow
    //   58: aload 5
    //   60: iload 8
    //   62: aaload
    //   63: aload_1
    //   64: aload_2
    //   65: invokeinterface 436 3 0
    //   70: iinc 8 1
    //   73: goto -30 -> 43
    //
    // Exception table:
    //   from	to	target	type
    //   7	35	51	finally
    //   53	55	51	finally
  }

  // ERROR //
  private void fireUserStatusListeners(String paramString, Object[] paramArrayOfObject)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 94	org/jivesoftware/smackx/muc/MultiUserChat:userStatusListeners	Ljava/util/List;
    //   4: astore_3
    //   5: aload_3
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 94	org/jivesoftware/smackx/muc/MultiUserChat:userStatusListeners	Ljava/util/List;
    //   11: invokeinterface 394 1 0
    //   16: anewarray 438	org/jivesoftware/smackx/muc/UserStatusListener
    //   19: astore 5
    //   21: aload_0
    //   22: getfield 94	org/jivesoftware/smackx/muc/MultiUserChat:userStatusListeners	Ljava/util/List;
    //   25: aload 5
    //   27: invokeinterface 400 2 0
    //   32: pop
    //   33: aload_3
    //   34: monitorexit
    //   35: aload_2
    //   36: arraylength
    //   37: anewarray 413	java/lang/Class
    //   40: astore 7
    //   42: iconst_0
    //   43: istore 8
    //   45: iload 8
    //   47: aload_2
    //   48: arraylength
    //   49: if_icmplt +37 -> 86
    //   52: ldc_w 438
    //   55: aload_1
    //   56: aload 7
    //   58: invokevirtual 417	java/lang/Class:getDeclaredMethod	(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
    //   61: astore 12
    //   63: aload 5
    //   65: arraylength
    //   66: istore 13
    //   68: iconst_0
    //   69: istore 14
    //   71: iload 14
    //   73: iload 13
    //   75: if_icmplt +29 -> 104
    //   78: return
    //   79: astore 4
    //   81: aload_3
    //   82: monitorexit
    //   83: aload 4
    //   85: athrow
    //   86: aload 7
    //   88: iload 8
    //   90: aload_2
    //   91: iload 8
    //   93: aaload
    //   94: invokevirtual 442	java/lang/Object:getClass	()Ljava/lang/Class;
    //   97: aastore
    //   98: iinc 8 1
    //   101: goto -56 -> 45
    //   104: aload 12
    //   106: aload 5
    //   108: iload 14
    //   110: aaload
    //   111: aload_2
    //   112: invokevirtual 426	java/lang/reflect/Method:invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    //   115: pop
    //   116: iinc 14 1
    //   119: goto -48 -> 71
    //   122: astore 11
    //   124: aload 11
    //   126: invokevirtual 429	java/lang/NoSuchMethodException:printStackTrace	()V
    //   129: goto -51 -> 78
    //   132: astore 10
    //   134: aload 10
    //   136: invokevirtual 430	java/lang/reflect/InvocationTargetException:printStackTrace	()V
    //   139: goto -61 -> 78
    //   142: astore 9
    //   144: aload 9
    //   146: invokevirtual 431	java/lang/IllegalAccessException:printStackTrace	()V
    //   149: goto -71 -> 78
    //
    // Exception table:
    //   from	to	target	type
    //   7	35	79	finally
    //   81	83	79	finally
    //   52	68	122	java/lang/NoSuchMethodException
    //   104	116	122	java/lang/NoSuchMethodException
    //   52	68	132	java/lang/reflect/InvocationTargetException
    //   104	116	132	java/lang/reflect/InvocationTargetException
    //   52	68	142	java/lang/IllegalAccessException
    //   104	116	142	java/lang/IllegalAccessException
  }

  private Collection<Affiliate> getAffiliatesByAdmin(String paramString)
    throws XMPPException
  {
    MUCAdmin localMUCAdmin1 = new MUCAdmin();
    localMUCAdmin1.setTo(this.room);
    localMUCAdmin1.setType(IQ.Type.GET);
    localMUCAdmin1.addItem(new MUCAdmin.Item(paramString, null));
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCAdmin1.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCAdmin1);
    MUCAdmin localMUCAdmin2 = (MUCAdmin)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localMUCAdmin2 == null)
      throw new XMPPException("No response from server.");
    if (localMUCAdmin2.getError() != null)
      throw new XMPPException(localMUCAdmin2.getError());
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = localMUCAdmin2.getItems();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return localArrayList;
      localArrayList.add(new Affiliate((MUCAdmin.Item)localIterator.next()));
    }
  }

  private Collection<Affiliate> getAffiliatesByOwner(String paramString)
    throws XMPPException
  {
    MUCOwner localMUCOwner1 = new MUCOwner();
    localMUCOwner1.setTo(this.room);
    localMUCOwner1.setType(IQ.Type.GET);
    localMUCOwner1.addItem(new MUCOwner.Item(paramString));
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCOwner1.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCOwner1);
    MUCOwner localMUCOwner2 = (MUCOwner)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localMUCOwner2 == null)
      throw new XMPPException("No response from server.");
    if (localMUCOwner2.getError() != null)
      throw new XMPPException(localMUCOwner2.getError());
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = localMUCOwner2.getItems();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return localArrayList;
      localArrayList.add(new Affiliate((MUCOwner.Item)localIterator.next()));
    }
  }

  public static Collection<HostedRoom> getHostedRooms(Connection paramConnection, String paramString)
    throws XMPPException
  {
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = ServiceDiscoveryManager.getInstanceFor(paramConnection).discoverItems(paramString).getItems();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return localArrayList;
      localArrayList.add(new HostedRoom((DiscoverItems.Item)localIterator.next()));
    }
  }

  private static Iterator<String> getJoinedRooms(Connection paramConnection)
  {
    Iterator localIterator;
    List localList = (List)joinedRooms.get(paramConnection);
    if (localList != null)
      localIterator = localList.iterator();
    while (true)
    {
      return localIterator;
      localIterator = new ArrayList().iterator();
    }
  }

  public static Iterator<String> getJoinedRooms(Connection paramConnection, String paramString)
  {
    ArrayList localArrayList;
    Iterator localIterator1;
    try
    {
      localArrayList = new ArrayList();
      Iterator localIterator2 = ServiceDiscoveryManager.getInstanceFor(paramConnection).discoverItems(paramString, "http://jabber.org/protocol/muc#rooms").getItems();
      if (!(localIterator2.hasNext()))
        localIterator1 = localArrayList.iterator();
      else
        localArrayList.add(((DiscoverItems.Item)localIterator2.next()).getEntityID());
    }
    catch (XMPPException localXMPPException)
    {
      localXMPPException.printStackTrace();
      localIterator1 = new ArrayList().iterator();
      return localIterator1;
    }
  }

  private MUCUser getMUCUserExtension(Packet paramPacket)
  {
    MUCUser localMUCUser;
    if (paramPacket != null)
      localMUCUser = (MUCUser)paramPacket.getExtension("x", "http://jabber.org/protocol/muc#user");
    while (true)
    {
      return localMUCUser;
      localMUCUser = null;
    }
  }

  private Collection<Occupant> getOccupants(String paramString)
    throws XMPPException
  {
    MUCAdmin localMUCAdmin1 = new MUCAdmin();
    localMUCAdmin1.setTo(this.room);
    localMUCAdmin1.setType(IQ.Type.GET);
    localMUCAdmin1.addItem(new MUCAdmin.Item(null, paramString));
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCAdmin1.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCAdmin1);
    MUCAdmin localMUCAdmin2 = (MUCAdmin)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localMUCAdmin2 == null)
      throw new XMPPException("No response from server.");
    if (localMUCAdmin2.getError() != null)
      throw new XMPPException(localMUCAdmin2.getError());
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = localMUCAdmin2.getItems();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return localArrayList;
      localArrayList.add(new Occupant((MUCAdmin.Item)localIterator.next()));
    }
  }

  public static RoomInfo getRoomInfo(Connection paramConnection, String paramString)
    throws XMPPException
  {
    return new RoomInfo(ServiceDiscoveryManager.getInstanceFor(paramConnection).discoverInfo(paramString));
  }

  public static Collection<String> getServiceNames(Connection paramConnection)
    throws XMPPException
  {
    ArrayList localArrayList = new ArrayList();
    ServiceDiscoveryManager localServiceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(paramConnection);
    Iterator localIterator = localServiceDiscoveryManager.discoverItems(paramConnection.getServiceName()).getItems();
    if (!(localIterator.hasNext()))
      return localArrayList;
    DiscoverItems.Item localItem = (DiscoverItems.Item)localIterator.next();
    try
    {
      if (!(localServiceDiscoveryManager.discoverInfo(localItem.getEntityID()).containsFeature("http://jabber.org/protocol/muc")));
      localArrayList.add(localItem.getEntityID());
    }
    catch (XMPPException localXMPPException)
    {
    }
  }

  private void init()
  {
    PacketFilter[] arrayOfPacketFilter1 = new PacketFilter[2];
    arrayOfPacketFilter1[0] = new FromMatchesFilter(this.room);
    arrayOfPacketFilter1[1] = new MessageTypeFilter(Message.Type.groupchat);
    this.messageFilter = new AndFilter(arrayOfPacketFilter1);
    PacketFilter[] arrayOfPacketFilter2 = new PacketFilter[2];
    arrayOfPacketFilter2[0] = this.messageFilter;
    arrayOfPacketFilter2[1] = new PacketFilter(this)
    {
      public boolean accept()
      {
        int i;
        if (((Message)paramPacket).getBody() != null)
          i = 1;
        while (true)
        {
          return i;
          i = 0;
        }
      }
    };
    this.messageFilter = new AndFilter(arrayOfPacketFilter2);
    PacketFilter[] arrayOfPacketFilter3 = new PacketFilter[2];
    arrayOfPacketFilter3[0] = new FromMatchesFilter(this.room);
    arrayOfPacketFilter3[1] = new PacketTypeFilter(Presence.class);
    this.presenceFilter = new AndFilter(arrayOfPacketFilter3);
    this.messageCollector = new ConnectionDetachedPacketCollector();
    4 local4 = new PacketListener(this)
    {
      public void processPacket()
      {
        Message localMessage = (Message)paramPacket;
        MultiUserChat.access$1(this.this$0, localMessage.getSubject());
        MultiUserChat.access$2(this.this$0, localMessage.getSubject(), localMessage.getFrom());
      }
    };
    5 local5 = new PacketListener(this)
    {
      public void processPacket()
      {
        Presence localPresence1 = (Presence)paramPacket;
        String str1 = localPresence1.getFrom();
        String str2 = MultiUserChat.access$3(this.this$0) + "/" + MultiUserChat.access$4(this.this$0);
        boolean bool = localPresence1.getFrom().equals(str2);
        if (localPresence1.getType() == Presence.Type.available)
        {
          Presence localPresence2 = (Presence)MultiUserChat.access$5(this.this$0).put(str1, localPresence1);
          if (localPresence2 != null)
          {
            MUCUser localMUCUser2 = MultiUserChat.access$6(this.this$0, localPresence2);
            String str3 = localMUCUser2.getItem().getAffiliation();
            String str4 = localMUCUser2.getItem().getRole();
            MUCUser localMUCUser3 = MultiUserChat.access$6(this.this$0, localPresence1);
            String str5 = localMUCUser3.getItem().getAffiliation();
            String str6 = localMUCUser3.getItem().getRole();
            MultiUserChat.access$7(this.this$0, str4, str6, bool, str1);
            MultiUserChat.access$8(this.this$0, str3, str5, bool, str1);
          }
        }
        while (true)
        {
          do
            while (true)
            {
              do
                while (true)
                {
                  do
                    return;
                  while (bool);
                  ArrayList localArrayList2 = new ArrayList();
                  localArrayList2.add(str1);
                  MultiUserChat.access$9(this.this$0, "joined", localArrayList2);
                }
              while (localPresence1.getType() != Presence.Type.unavailable);
              MultiUserChat.access$5(this.this$0).remove(str1);
              MUCUser localMUCUser1 = MultiUserChat.access$6(this.this$0, localPresence1);
              if ((localMUCUser1 == null) || (localMUCUser1.getStatus() == null))
                break;
              MultiUserChat.access$10(this.this$0, localMUCUser1.getStatus().getCode(), localPresence1.getFrom().equals(str2), localMUCUser1, str1);
            }
          while (bool);
          ArrayList localArrayList1 = new ArrayList();
          localArrayList1.add(str1);
          MultiUserChat.access$9(this.this$0, "left", localArrayList1);
        }
      }
    };
    6 local6 = new PacketListener(this)
    {
      public void processPacket()
      {
        MUCUser localMUCUser = MultiUserChat.access$6(this.this$0, paramPacket);
        if ((localMUCUser.getDecline() != null) && (((Message)paramPacket).getType() != Message.Type.error))
          MultiUserChat.access$11(this.this$0, localMUCUser.getDecline().getFrom(), localMUCUser.getDecline().getReason());
      }
    };
    PacketMultiplexListener localPacketMultiplexListener = new PacketMultiplexListener(this.messageCollector, local5, local4, local6);
    this.roomListenerMultiplexor = RoomListenerMultiplexor.getRoomMultiplexor(this.connection);
    this.roomListenerMultiplexor.addRoom(this.room, localPacketMultiplexListener);
  }

  public static boolean isServiceEnabled(Connection paramConnection, String paramString)
  {
    boolean bool1;
    boolean bool2;
    try
    {
      bool2 = ServiceDiscoveryManager.getInstanceFor(paramConnection).discoverInfo(paramString).containsFeature("http://jabber.org/protocol/muc");
      bool1 = bool2;
      return bool1;
    }
    catch (XMPPException localXMPPException)
    {
      localXMPPException.printStackTrace();
      bool1 = false;
    }
  }

  public static void removeInvitationListener(Connection paramConnection, InvitationListener paramInvitationListener)
  {
    InvitationsMonitor.getInvitationsMonitor(paramConnection).removeInvitationListener(paramInvitationListener);
  }

  /**
   * @deprecated
   */
  private void userHasJoined()
  {
    monitorenter;
    try
    {
      Object localObject2 = (List)joinedRooms.get(this.connection);
      if (localObject2 == null)
      {
        localObject2 = new ArrayList();
        joinedRooms.put(this.connection, localObject2);
      }
      ((List)localObject2).add(this.room);
      monitorexit;
      return;
    }
    finally
    {
      localObject1 = finally;
      monitorexit;
      throw localObject1;
    }
  }

  /**
   * @deprecated
   */
  private void userHasLeft()
  {
    List localList;
    monitorenter;
    try
    {
      localList = (List)joinedRooms.get(this.connection);
      if (localList == null)
      {
        monitorexit;
        return;
      }
    }
    finally
    {
      monitorexit;
    }
  }

  public void addInvitationRejectionListener(InvitationRejectionListener paramInvitationRejectionListener)
  {
    synchronized (this.invitationRejectionListeners)
    {
      if (!(this.invitationRejectionListeners.contains(paramInvitationRejectionListener)))
        this.invitationRejectionListeners.add(paramInvitationRejectionListener);
      return;
    }
  }

  public void addMessageListener(PacketListener paramPacketListener)
  {
    this.connection.addPacketListener(paramPacketListener, this.messageFilter);
    this.connectionListeners.add(paramPacketListener);
  }

  public void addParticipantListener(PacketListener paramPacketListener)
  {
    this.connection.addPacketListener(paramPacketListener, this.presenceFilter);
    this.connectionListeners.add(paramPacketListener);
  }

  public void addParticipantStatusListener(ParticipantStatusListener paramParticipantStatusListener)
  {
    synchronized (this.participantStatusListeners)
    {
      if (!(this.participantStatusListeners.contains(paramParticipantStatusListener)))
        this.participantStatusListeners.add(paramParticipantStatusListener);
      return;
    }
  }

  public void addPresenceInterceptor(PacketInterceptor paramPacketInterceptor)
  {
    this.presenceInterceptors.add(paramPacketInterceptor);
  }

  public void addSubjectUpdatedListener(SubjectUpdatedListener paramSubjectUpdatedListener)
  {
    synchronized (this.subjectUpdatedListeners)
    {
      if (!(this.subjectUpdatedListeners.contains(paramSubjectUpdatedListener)))
        this.subjectUpdatedListeners.add(paramSubjectUpdatedListener);
      return;
    }
  }

  public void addUserStatusListener(UserStatusListener paramUserStatusListener)
  {
    synchronized (this.userStatusListeners)
    {
      if (!(this.userStatusListeners.contains(paramUserStatusListener)))
        this.userStatusListeners.add(paramUserStatusListener);
      return;
    }
  }

  public void banUser(String paramString1, String paramString2)
    throws XMPPException
  {
    changeAffiliationByAdmin(paramString1, "outcast", paramString2);
  }

  public void banUsers(Collection<String> paramCollection)
    throws XMPPException
  {
    changeAffiliationByAdmin(paramCollection, "outcast");
  }

  public void changeAvailabilityStatus(String paramString, Presence.Mode paramMode)
  {
    if ((this.nickname == null) || (this.nickname.equals("")))
      throw new IllegalArgumentException("Nickname must not be null or blank.");
    if (!(this.joined))
      throw new IllegalStateException("Must be logged into the room to change the availability status.");
    Presence localPresence = new Presence(Presence.Type.available);
    localPresence.setStatus(paramString);
    localPresence.setMode(paramMode);
    localPresence.setTo(this.room + "/" + this.nickname);
    Iterator localIterator = this.presenceInterceptors.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        this.connection.sendPacket(localPresence);
        return;
      }
      ((PacketInterceptor)localIterator.next()).interceptPacket(localPresence);
    }
  }

  public void changeNickname(String paramString)
    throws XMPPException
  {
    Presence localPresence2;
    if ((paramString == null) || (paramString.equals("")))
      throw new IllegalArgumentException("Nickname must not be null or blank.");
    if (!(this.joined))
      throw new IllegalStateException("Must be logged into the room to change nickname.");
    Presence localPresence1 = new Presence(Presence.Type.available);
    localPresence1.setTo(this.room + "/" + paramString);
    Iterator localIterator = this.presenceInterceptors.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        PacketFilter[] arrayOfPacketFilter = new PacketFilter[2];
        arrayOfPacketFilter[0] = new FromMatchesFilter(this.room + "/" + paramString);
        arrayOfPacketFilter[1] = new PacketTypeFilter(Presence.class);
        AndFilter localAndFilter = new AndFilter(arrayOfPacketFilter);
        PacketCollector localPacketCollector = this.connection.createPacketCollector(localAndFilter);
        this.connection.sendPacket(localPresence1);
        localPresence2 = (Presence)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
        localPacketCollector.cancel();
        if (localPresence2 != null)
          break;
        throw new XMPPException("No response from server.");
      }
      ((PacketInterceptor)localIterator.next()).interceptPacket(localPresence1);
    }
    if (localPresence2.getError() != null)
      throw new XMPPException(localPresence2.getError());
    this.nickname = paramString;
  }

  public void changeSubject(String paramString)
    throws XMPPException
  {
    Message localMessage1 = new Message(this.room, Message.Type.groupchat);
    localMessage1.setSubject(paramString);
    PacketFilter[] arrayOfPacketFilter1 = new PacketFilter[2];
    arrayOfPacketFilter1[0] = new FromMatchesFilter(this.room);
    arrayOfPacketFilter1[1] = new PacketTypeFilter(Message.class);
    AndFilter localAndFilter1 = new AndFilter(arrayOfPacketFilter1);
    PacketFilter[] arrayOfPacketFilter2 = new PacketFilter[2];
    arrayOfPacketFilter2[0] = localAndFilter1;
    arrayOfPacketFilter2[1] = new PacketFilter(this, paramString)
    {
      public boolean accept()
      {
        Message localMessage = (Message)paramPacket;
        return this.val$subject.equals(localMessage.getSubject());
      }
    };
    AndFilter localAndFilter2 = new AndFilter(arrayOfPacketFilter2);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localAndFilter2);
    this.connection.sendPacket(localMessage1);
    Message localMessage2 = (Message)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localMessage2 == null)
      throw new XMPPException("No response from server.");
    if (localMessage2.getError() != null)
      throw new XMPPException(localMessage2.getError());
  }

  /**
   * @deprecated
   */
  public void create(String paramString)
    throws XMPPException
  {
    monitorenter;
    if (paramString != null);
    try
    {
      throw new IllegalArgumentException("Nickname must not be null or blank.");
    }
    finally
    {
      Presence localPresence2;
      monitorexit;
      throw localObject;
      if (this.joined)
        throw new IllegalStateException("Creation failed - User already joined the room.");
      Presence localPresence1 = new Presence(Presence.Type.available);
      localPresence1.setTo(this.room + "/" + paramString);
      localPresence1.addExtension(new MUCInitialPresence());
      Iterator localIterator = this.presenceInterceptors.iterator();
      while (true)
      {
        if (!(localIterator.hasNext()))
        {
          PacketFilter[] arrayOfPacketFilter = new PacketFilter[2];
          arrayOfPacketFilter[0] = new FromMatchesFilter(this.room + "/" + paramString);
          arrayOfPacketFilter[1] = new PacketTypeFilter(Presence.class);
          AndFilter localAndFilter = new AndFilter(arrayOfPacketFilter);
          PacketCollector localPacketCollector = this.connection.createPacketCollector(localAndFilter);
          this.connection.sendPacket(localPresence1);
          localPresence2 = (Presence)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
          localPacketCollector.cancel();
          if (localPresence2 != null)
            break;
          throw new XMPPException("No response from server.");
        }
        ((PacketInterceptor)localIterator.next()).interceptPacket(localPresence1);
      }
      if (localPresence2.getError() != null)
        throw new XMPPException(localPresence2.getError());
      this.nickname = paramString;
      this.joined = true;
      userHasJoined();
      MUCUser localMUCUser = getMUCUserExtension(localPresence2);
      if ((localMUCUser != null) && (localMUCUser.getStatus() != null))
      {
        boolean bool = "201".equals(localMUCUser.getStatus().getCode());
        if (bool)
        {
          monitorexit;
          return;
        }
      }
      leave();
    }
  }

  public Message createMessage()
  {
    return new Message(this.room, Message.Type.groupchat);
  }

  public Chat createPrivateChat(String paramString, MessageListener paramMessageListener)
  {
    return this.connection.getChatManager().createChat(paramString, paramMessageListener);
  }

  public void destroy(String paramString1, String paramString2)
    throws XMPPException
  {
    MUCOwner localMUCOwner = new MUCOwner();
    localMUCOwner.setTo(this.room);
    localMUCOwner.setType(IQ.Type.SET);
    MUCOwner.Destroy localDestroy = new MUCOwner.Destroy();
    localDestroy.setReason(paramString1);
    localDestroy.setJid(paramString2);
    localMUCOwner.setDestroy(localDestroy);
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCOwner.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCOwner);
    IQ localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from server.");
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
    this.occupantsMap.clear();
    this.nickname = null;
    this.joined = false;
    userHasLeft();
  }

  // ERROR //
  protected void finalize()
    throws java.lang.Throwable
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 102	org/jivesoftware/smackx/muc/MultiUserChat:connection	Lorg/jivesoftware/smack/Connection;
    //   4: ifnull +35 -> 39
    //   7: aload_0
    //   8: getfield 589	org/jivesoftware/smackx/muc/MultiUserChat:roomListenerMultiplexor	Lorg/jivesoftware/smackx/muc/RoomListenerMultiplexor;
    //   11: aload_0
    //   12: getfield 110	org/jivesoftware/smackx/muc/MultiUserChat:room	Ljava/lang/String;
    //   15: invokevirtual 757	org/jivesoftware/smackx/muc/RoomListenerMultiplexor:removeRoom	(Ljava/lang/String;)V
    //   18: aload_0
    //   19: getfield 100	org/jivesoftware/smackx/muc/MultiUserChat:connectionListeners	Ljava/util/List;
    //   22: invokeinterface 487 1 0
    //   27: astore_2
    //   28: aload_2
    //   29: invokeinterface 264 1 0
    //   34: istore_3
    //   35: iload_3
    //   36: ifne +8 -> 44
    //   39: aload_0
    //   40: invokespecial 759	java/lang/Object:finalize	()V
    //   43: return
    //   44: aload_2
    //   45: invokeinterface 268 1 0
    //   50: checkcast 761	org/jivesoftware/smack/PacketListener
    //   53: astore 4
    //   55: aload_0
    //   56: getfield 102	org/jivesoftware/smackx/muc/MultiUserChat:connection	Lorg/jivesoftware/smack/Connection;
    //   59: aload 4
    //   61: invokevirtual 764	org/jivesoftware/smack/Connection:removePacketListener	(Lorg/jivesoftware/smack/PacketListener;)V
    //   64: goto -36 -> 28
    //   67: astore_1
    //   68: goto -29 -> 39
    //
    // Exception table:
    //   from	to	target	type
    //   0	35	67	java/lang/Exception
    //   44	64	67	java/lang/Exception
  }

  public Collection<Affiliate> getAdmins()
    throws XMPPException
  {
    return getAffiliatesByOwner("admin");
  }

  public Form getConfigurationForm()
    throws XMPPException
  {
    MUCOwner localMUCOwner = new MUCOwner();
    localMUCOwner.setTo(this.room);
    localMUCOwner.setType(IQ.Type.GET);
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCOwner.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCOwner);
    IQ localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from server.");
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
    return Form.getFormFrom(localIQ);
  }

  public Collection<Affiliate> getMembers()
    throws XMPPException
  {
    return getAffiliatesByAdmin("member");
  }

  public Collection<Occupant> getModerators()
    throws XMPPException
  {
    return getOccupants("moderator");
  }

  public String getNickname()
  {
    return this.nickname;
  }

  public Occupant getOccupant(String paramString)
  {
    Occupant localOccupant;
    Presence localPresence = (Presence)this.occupantsMap.get(paramString);
    if (localPresence != null)
      localOccupant = new Occupant(localPresence);
    while (true)
    {
      return localOccupant;
      localOccupant = null;
    }
  }

  public Presence getOccupantPresence(String paramString)
  {
    return ((Presence)this.occupantsMap.get(paramString));
  }

  public Iterator<String> getOccupants()
  {
    return Collections.unmodifiableList(new ArrayList(this.occupantsMap.keySet())).iterator();
  }

  public int getOccupantsCount()
  {
    return this.occupantsMap.size();
  }

  public Collection<Affiliate> getOutcasts()
    throws XMPPException
  {
    return getAffiliatesByAdmin("outcast");
  }

  public Collection<Affiliate> getOwners()
    throws XMPPException
  {
    return getAffiliatesByOwner("owner");
  }

  public Collection<Occupant> getParticipants()
    throws XMPPException
  {
    return getOccupants("participant");
  }

  public Form getRegistrationForm()
    throws XMPPException
  {
    Registration localRegistration = new Registration();
    localRegistration.setType(IQ.Type.GET);
    localRegistration.setTo(this.room);
    PacketFilter[] arrayOfPacketFilter = new PacketFilter[2];
    arrayOfPacketFilter[0] = new PacketIDFilter(localRegistration.getPacketID());
    arrayOfPacketFilter[1] = new PacketTypeFilter(IQ.class);
    AndFilter localAndFilter = new AndFilter(arrayOfPacketFilter);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localAndFilter);
    this.connection.sendPacket(localRegistration);
    IQ localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from server.");
    if (localIQ.getType() == IQ.Type.ERROR)
      throw new XMPPException(localIQ.getError());
    return Form.getFormFrom(localIQ);
  }

  public String getReservedNickname()
  {
    String str1;
    Iterator localIterator;
    try
    {
      localIterator = ServiceDiscoveryManager.getInstanceFor(this.connection).discoverInfo(this.room, "x-roomuser-item").getIdentities();
      if (localIterator.hasNext())
      {
        String str2 = ((DiscoverInfo.Identity)localIterator.next()).getName();
        str1 = str2;
        return str1;
      }
      str1 = null;
    }
    catch (XMPPException localXMPPException)
    {
      localXMPPException.printStackTrace();
      str1 = null;
    }
  }

  public String getRoom()
  {
    return this.room;
  }

  public String getSubject()
  {
    return this.subject;
  }

  public void grantAdmin(String paramString)
    throws XMPPException
  {
    changeAffiliationByOwner(paramString, "admin");
  }

  public void grantAdmin(Collection<String> paramCollection)
    throws XMPPException
  {
    changeAffiliationByOwner(paramCollection, "admin");
  }

  public void grantMembership(String paramString)
    throws XMPPException
  {
    changeAffiliationByAdmin(paramString, "member", null);
  }

  public void grantMembership(Collection<String> paramCollection)
    throws XMPPException
  {
    changeAffiliationByAdmin(paramCollection, "member");
  }

  public void grantModerator(String paramString)
    throws XMPPException
  {
    changeRole(paramString, "moderator", null);
  }

  public void grantModerator(Collection<String> paramCollection)
    throws XMPPException
  {
    changeRole(paramCollection, "moderator");
  }

  public void grantOwnership(String paramString)
    throws XMPPException
  {
    changeAffiliationByOwner(paramString, "owner");
  }

  public void grantOwnership(Collection<String> paramCollection)
    throws XMPPException
  {
    changeAffiliationByOwner(paramCollection, "owner");
  }

  public void grantVoice(String paramString)
    throws XMPPException
  {
    changeRole(paramString, "participant", null);
  }

  public void grantVoice(Collection<String> paramCollection)
    throws XMPPException
  {
    changeRole(paramCollection, "participant");
  }

  public void invite(String paramString1, String paramString2)
  {
    invite(new Message(), paramString1, paramString2);
  }

  public void invite(Message paramMessage, String paramString1, String paramString2)
  {
    paramMessage.setTo(this.room);
    MUCUser localMUCUser = new MUCUser();
    MUCUser.Invite localInvite = new MUCUser.Invite();
    localInvite.setTo(paramString1);
    localInvite.setReason(paramString2);
    localMUCUser.setInvite(localInvite);
    paramMessage.addExtension(localMUCUser);
    this.connection.sendPacket(paramMessage);
  }

  public boolean isJoined()
  {
    return this.joined;
  }

  public void join(String paramString)
    throws XMPPException
  {
    join(paramString, null, null, SmackConfiguration.getPacketReplyTimeout());
  }

  public void join(String paramString1, String paramString2)
    throws XMPPException
  {
    join(paramString1, paramString2, null, SmackConfiguration.getPacketReplyTimeout());
  }

  /**
   * @deprecated
   */
  // ERROR //
  public void join(String paramString1, String paramString2, DiscussionHistory paramDiscussionHistory, long paramLong)
    throws XMPPException
  {
    // Byte code:
    //   0: aload_0
    //   1: monitorenter
    //   2: aload_1
    //   3: ifnull +13 -> 16
    //   6: aload_1
    //   7: ldc_w 639
    //   10: invokevirtual 292	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   13: ifeq +21 -> 34
    //   16: new 641	java/lang/IllegalArgumentException
    //   19: dup
    //   20: ldc_w 643
    //   23: invokespecial 644	java/lang/IllegalArgumentException:<init>	(Ljava/lang/String;)V
    //   26: athrow
    //   27: astore 6
    //   29: aload_0
    //   30: monitorexit
    //   31: aload 6
    //   33: athrow
    //   34: aload_0
    //   35: getfield 80	org/jivesoftware/smackx/muc/MultiUserChat:joined	Z
    //   38: ifeq +7 -> 45
    //   41: aload_0
    //   42: invokevirtual 724	org/jivesoftware/smackx/muc/MultiUserChat:leave	()V
    //   45: new 563	org/jivesoftware/smack/packet/Presence
    //   48: dup
    //   49: getstatic 655	org/jivesoftware/smack/packet/Presence$Type:available	Lorg/jivesoftware/smack/packet/Presence$Type;
    //   52: invokespecial 658	org/jivesoftware/smack/packet/Presence:<init>	(Lorg/jivesoftware/smack/packet/Presence$Type;)V
    //   55: astore 7
    //   57: aload 7
    //   59: new 667	java/lang/StringBuilder
    //   62: dup
    //   63: aload_0
    //   64: getfield 110	org/jivesoftware/smackx/muc/MultiUserChat:room	Ljava/lang/String;
    //   67: invokestatic 671	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   70: invokespecial 672	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   73: ldc_w 674
    //   76: invokevirtual 678	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   79: aload_1
    //   80: invokevirtual 678	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   83: invokevirtual 681	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   86: invokevirtual 682	org/jivesoftware/smack/packet/Presence:setTo	(Ljava/lang/String;)V
    //   89: new 706	org/jivesoftware/smackx/packet/MUCInitialPresence
    //   92: dup
    //   93: invokespecial 707	org/jivesoftware/smackx/packet/MUCInitialPresence:<init>	()V
    //   96: astore 8
    //   98: aload_2
    //   99: ifnull +9 -> 108
    //   102: aload 8
    //   104: aload_2
    //   105: invokevirtual 873	org/jivesoftware/smackx/packet/MUCInitialPresence:setPassword	(Ljava/lang/String;)V
    //   108: aload_3
    //   109: ifnull +12 -> 121
    //   112: aload 8
    //   114: aload_3
    //   115: invokevirtual 879	org/jivesoftware/smackx/muc/DiscussionHistory:getMUCHistory	()Lorg/jivesoftware/smackx/packet/MUCInitialPresence$History;
    //   118: invokevirtual 883	org/jivesoftware/smackx/packet/MUCInitialPresence:setHistory	(Lorg/jivesoftware/smackx/packet/MUCInitialPresence$History;)V
    //   121: aload 7
    //   123: aload 8
    //   125: invokevirtual 708	org/jivesoftware/smack/packet/Presence:addExtension	(Lorg/jivesoftware/smack/packet/PacketExtension;)V
    //   128: aload_0
    //   129: getfield 98	org/jivesoftware/smackx/muc/MultiUserChat:presenceInterceptors	Ljava/util/List;
    //   132: invokeinterface 487 1 0
    //   137: astore 9
    //   139: aload 9
    //   141: invokeinterface 264 1 0
    //   146: ifne +132 -> 278
    //   149: iconst_2
    //   150: anewarray 535	org/jivesoftware/smack/filter/PacketFilter
    //   153: astore 10
    //   155: aload 10
    //   157: iconst_0
    //   158: new 537	org/jivesoftware/smack/filter/FromMatchesFilter
    //   161: dup
    //   162: new 667	java/lang/StringBuilder
    //   165: dup
    //   166: aload_0
    //   167: getfield 110	org/jivesoftware/smackx/muc/MultiUserChat:room	Ljava/lang/String;
    //   170: invokestatic 671	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   173: invokespecial 672	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   176: ldc_w 674
    //   179: invokevirtual 678	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   182: aload_1
    //   183: invokevirtual 678	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   186: invokevirtual 681	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   189: invokespecial 538	org/jivesoftware/smack/filter/FromMatchesFilter:<init>	(Ljava/lang/String;)V
    //   192: aastore
    //   193: aload 10
    //   195: iconst_1
    //   196: new 561	org/jivesoftware/smack/filter/PacketTypeFilter
    //   199: dup
    //   200: ldc_w 563
    //   203: invokespecial 566	org/jivesoftware/smack/filter/PacketTypeFilter:<init>	(Ljava/lang/Class;)V
    //   206: aastore
    //   207: new 551	org/jivesoftware/smack/filter/AndFilter
    //   210: dup
    //   211: aload 10
    //   213: invokespecial 554	org/jivesoftware/smack/filter/AndFilter:<init>	([Lorg/jivesoftware/smack/filter/PacketFilter;)V
    //   216: astore 11
    //   218: aconst_null
    //   219: astore 12
    //   221: aload_0
    //   222: getfield 102	org/jivesoftware/smackx/muc/MultiUserChat:connection	Lorg/jivesoftware/smack/Connection;
    //   225: aload 11
    //   227: invokevirtual 220	org/jivesoftware/smack/Connection:createPacketCollector	(Lorg/jivesoftware/smack/filter/PacketFilter;)Lorg/jivesoftware/smack/PacketCollector;
    //   230: astore 12
    //   232: aload_0
    //   233: getfield 102	org/jivesoftware/smackx/muc/MultiUserChat:connection	Lorg/jivesoftware/smack/Connection;
    //   236: aload 7
    //   238: invokevirtual 224	org/jivesoftware/smack/Connection:sendPacket	(Lorg/jivesoftware/smack/packet/Packet;)V
    //   241: aload 12
    //   243: lload 4
    //   245: invokevirtual 236	org/jivesoftware/smack/PacketCollector:nextResult	(J)Lorg/jivesoftware/smack/packet/Packet;
    //   248: checkcast 563	org/jivesoftware/smack/packet/Presence
    //   251: astore 14
    //   253: aload 12
    //   255: ifnull +8 -> 263
    //   258: aload 12
    //   260: invokevirtual 241	org/jivesoftware/smack/PacketCollector:cancel	()V
    //   263: aload 14
    //   265: ifnonnull +48 -> 313
    //   268: new 178	XMPPException
    //   271: dup
    //   272: ldc 243
    //   274: invokespecial 244	XMPPException:<init>	(Ljava/lang/String;)V
    //   277: athrow
    //   278: aload 9
    //   280: invokeinterface 268 1 0
    //   285: checkcast 684	org/jivesoftware/smack/PacketInterceptor
    //   288: aload 7
    //   290: invokeinterface 687 2 0
    //   295: goto -156 -> 139
    //   298: astore 13
    //   300: aload 12
    //   302: ifnull +8 -> 310
    //   305: aload 12
    //   307: invokevirtual 241	org/jivesoftware/smack/PacketCollector:cancel	()V
    //   310: aload 13
    //   312: athrow
    //   313: aload 14
    //   315: invokevirtual 691	org/jivesoftware/smack/packet/Presence:getError	()Lorg/jivesoftware/smack/packet/XMPPError;
    //   318: ifnull +16 -> 334
    //   321: new 178	XMPPException
    //   324: dup
    //   325: aload 14
    //   327: invokevirtual 691	org/jivesoftware/smack/packet/Presence:getError	()Lorg/jivesoftware/smack/packet/XMPPError;
    //   330: invokespecial 251	XMPPException:<init>	(Lorg/jivesoftware/smack/packet/XMPPError;)V
    //   333: athrow
    //   334: aload_0
    //   335: aload_1
    //   336: putfield 78	org/jivesoftware/smackx/muc/MultiUserChat:nickname	Ljava/lang/String;
    //   339: aload_0
    //   340: iconst_1
    //   341: putfield 80	org/jivesoftware/smackx/muc/MultiUserChat:joined	Z
    //   344: aload_0
    //   345: invokespecial 710	org/jivesoftware/smackx/muc/MultiUserChat:userHasJoined	()V
    //   348: aload_0
    //   349: monitorexit
    //   350: return
    //
    // Exception table:
    //   from	to	target	type
    //   6	27	27	finally
    //   34	218	27	finally
    //   258	348	27	finally
    //   221	253	298	finally
  }

  public void kickParticipant(String paramString1, String paramString2)
    throws XMPPException
  {
    changeRole(paramString1, "none", paramString2);
  }

  /**
   * @deprecated
   */
  public void leave()
  {
    Presence localPresence;
    Iterator localIterator;
    monitorenter;
    try
    {
      boolean bool = this.joined;
      if (!(bool))
      {
        monitorexit;
        return;
      }
      localPresence = new Presence(Presence.Type.unavailable);
      localPresence.setTo(this.room + "/" + this.nickname);
      localIterator = this.presenceInterceptors.iterator();
      if (!(localIterator.hasNext()))
        this.connection.sendPacket(localPresence);
    }
    finally
    {
      while (true)
      {
        monitorexit;
        throw localObject;
        ((PacketInterceptor)localIterator.next()).interceptPacket(localPresence);
      }
    }
  }

  public Message nextMessage()
  {
    return ((Message)this.messageCollector.nextResult());
  }

  public Message nextMessage(long paramLong)
  {
    return ((Message)this.messageCollector.nextResult(paramLong));
  }

  public Message pollMessage()
  {
    return ((Message)this.messageCollector.pollResult());
  }

  public void removeInvitationRejectionListener(InvitationRejectionListener paramInvitationRejectionListener)
  {
    synchronized (this.invitationRejectionListeners)
    {
      this.invitationRejectionListeners.remove(paramInvitationRejectionListener);
      return;
    }
  }

  public void removeMessageListener(PacketListener paramPacketListener)
  {
    this.connection.removePacketListener(paramPacketListener);
    this.connectionListeners.remove(paramPacketListener);
  }

  public void removeParticipantListener(PacketListener paramPacketListener)
  {
    this.connection.removePacketListener(paramPacketListener);
    this.connectionListeners.remove(paramPacketListener);
  }

  public void removeParticipantStatusListener(ParticipantStatusListener paramParticipantStatusListener)
  {
    synchronized (this.participantStatusListeners)
    {
      this.participantStatusListeners.remove(paramParticipantStatusListener);
      return;
    }
  }

  public void removePresenceInterceptor(PacketInterceptor paramPacketInterceptor)
  {
    this.presenceInterceptors.remove(paramPacketInterceptor);
  }

  public void removeSubjectUpdatedListener(SubjectUpdatedListener paramSubjectUpdatedListener)
  {
    synchronized (this.subjectUpdatedListeners)
    {
      this.subjectUpdatedListeners.remove(paramSubjectUpdatedListener);
      return;
    }
  }

  public void removeUserStatusListener(UserStatusListener paramUserStatusListener)
  {
    synchronized (this.userStatusListeners)
    {
      this.userStatusListeners.remove(paramUserStatusListener);
      return;
    }
  }

  public void revokeAdmin(String paramString)
    throws XMPPException
  {
    changeAffiliationByOwner(paramString, "member");
  }

  public void revokeAdmin(Collection<String> paramCollection)
    throws XMPPException
  {
    changeAffiliationByOwner(paramCollection, "member");
  }

  public void revokeMembership(String paramString)
    throws XMPPException
  {
    changeAffiliationByAdmin(paramString, "none", null);
  }

  public void revokeMembership(Collection<String> paramCollection)
    throws XMPPException
  {
    changeAffiliationByAdmin(paramCollection, "none");
  }

  public void revokeModerator(String paramString)
    throws XMPPException
  {
    changeRole(paramString, "participant", null);
  }

  public void revokeModerator(Collection<String> paramCollection)
    throws XMPPException
  {
    changeRole(paramCollection, "participant");
  }

  public void revokeOwnership(String paramString)
    throws XMPPException
  {
    changeAffiliationByOwner(paramString, "admin");
  }

  public void revokeOwnership(Collection<String> paramCollection)
    throws XMPPException
  {
    changeAffiliationByOwner(paramCollection, "admin");
  }

  public void revokeVoice(String paramString)
    throws XMPPException
  {
    changeRole(paramString, "visitor", null);
  }

  public void revokeVoice(Collection<String> paramCollection)
    throws XMPPException
  {
    changeRole(paramCollection, "visitor");
  }

  public void sendConfigurationForm(Form paramForm)
    throws XMPPException
  {
    MUCOwner localMUCOwner = new MUCOwner();
    localMUCOwner.setTo(this.room);
    localMUCOwner.setType(IQ.Type.SET);
    localMUCOwner.addExtension(paramForm.getDataFormToSend());
    PacketIDFilter localPacketIDFilter = new PacketIDFilter(localMUCOwner.getPacketID());
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localPacketIDFilter);
    this.connection.sendPacket(localMUCOwner);
    IQ localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from server.");
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
  }

  public void sendMessage(String paramString)
    throws XMPPException
  {
    Message localMessage = new Message(this.room, Message.Type.groupchat);
    localMessage.setBody(paramString);
    this.connection.sendPacket(localMessage);
  }

  public void sendMessage(Message paramMessage)
    throws XMPPException
  {
    this.connection.sendPacket(paramMessage);
  }

  public void sendRegistrationForm(Form paramForm)
    throws XMPPException
  {
    Registration localRegistration = new Registration();
    localRegistration.setType(IQ.Type.SET);
    localRegistration.setTo(this.room);
    localRegistration.addExtension(paramForm.getDataFormToSend());
    PacketFilter[] arrayOfPacketFilter = new PacketFilter[2];
    arrayOfPacketFilter[0] = new PacketIDFilter(localRegistration.getPacketID());
    arrayOfPacketFilter[1] = new PacketTypeFilter(IQ.class);
    AndFilter localAndFilter = new AndFilter(arrayOfPacketFilter);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(localAndFilter);
    this.connection.sendPacket(localRegistration);
    IQ localIQ = (IQ)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from server.");
    if (localIQ.getType() == IQ.Type.ERROR)
      throw new XMPPException(localIQ.getError());
  }

  private static class InvitationsMonitor
  implements ConnectionListener
  {
    private static final Map<Connection, WeakReference<InvitationsMonitor>> monitors = new WeakHashMap();
    private Connection connection;
    private PacketFilter invitationFilter;
    private PacketListener invitationPacketListener;
    private final List<InvitationListener> invitationsListeners = new ArrayList();

    private InvitationsMonitor(Connection paramConnection)
    {
      this.connection = paramConnection;
    }

    private void cancel()
    {
      this.connection.removePacketListener(this.invitationPacketListener);
      this.connection.removeConnectionListener(this);
    }

    // ERROR //
    private void fireInvitationListeners(String paramString1, String paramString2, String paramString3, String paramString4, Message paramMessage)
    {
      // Byte code:
      //   0: aload_0
      //   1: getfield 39	org/jivesoftware/smackx/muc/MultiUserChat$InvitationsMonitor:invitationsListeners	Ljava/util/List;
      //   4: astore 6
      //   6: aload 6
      //   8: monitorenter
      //   9: aload_0
      //   10: getfield 39	org/jivesoftware/smackx/muc/MultiUserChat$InvitationsMonitor:invitationsListeners	Ljava/util/List;
      //   13: invokeinterface 66 1 0
      //   18: anewarray 68	org/jivesoftware/smackx/muc/InvitationListener
      //   21: astore 8
      //   23: aload_0
      //   24: getfield 39	org/jivesoftware/smackx/muc/MultiUserChat$InvitationsMonitor:invitationsListeners	Ljava/util/List;
      //   27: aload 8
      //   29: invokeinterface 72 2 0
      //   34: pop
      //   35: aload 6
      //   37: monitorexit
      //   38: aload 8
      //   40: arraylength
      //   41: istore 10
      //   43: iconst_0
      //   44: istore 11
      //   46: iload 11
      //   48: iload 10
      //   50: if_icmplt +12 -> 62
      //   53: return
      //   54: astore 7
      //   56: aload 6
      //   58: monitorexit
      //   59: aload 7
      //   61: athrow
      //   62: aload 8
      //   64: iload 11
      //   66: aaload
      //   67: aload_0
      //   68: getfield 41	org/jivesoftware/smackx/muc/MultiUserChat$InvitationsMonitor:connection	Lorg/jivesoftware/smack/Connection;
      //   71: aload_1
      //   72: aload_2
      //   73: aload_3
      //   74: aload 4
      //   76: aload 5
      //   78: invokeinterface 76 7 0
      //   83: iinc 11 1
      //   86: goto -40 -> 46
      //
      // Exception table:
      //   from	to	target	type
      //   9	38	54	finally
      //   56	59	54	finally
    }

    public static InvitationsMonitor getInvitationsMonitor(Connection paramConnection)
    {
      synchronized (monitors)
      {
        if (!(monitors.containsKey(paramConnection)))
          monitors.put(paramConnection, new WeakReference(new InvitationsMonitor(paramConnection)));
        InvitationsMonitor localInvitationsMonitor = (InvitationsMonitor)((WeakReference)monitors.get(paramConnection)).get();
        return localInvitationsMonitor;
      }
    }

    private void init()
    {
      this.invitationFilter = new PacketExtensionFilter("x", "http://jabber.org/protocol/muc#user");
      this.invitationPacketListener = new PacketListener(this)
      {
        public void processPacket()
        {
          MUCUser localMUCUser = (MUCUser)paramPacket.getExtension("x", "http://jabber.org/protocol/muc#user");
          if ((localMUCUser.getInvite() != null) && (((Message)paramPacket).getType() != Message.Type.error))
            MultiUserChat.InvitationsMonitor.access$0(this.this$1, paramPacket.getFrom(), localMUCUser.getInvite().getFrom(), localMUCUser.getInvite().getReason(), localMUCUser.getPassword(), (Message)paramPacket);
        }
      };
      this.connection.addPacketListener(this.invitationPacketListener, this.invitationFilter);
      this.connection.addConnectionListener(this);
    }

    public void addInvitationListener(InvitationListener paramInvitationListener)
    {
      synchronized (this.invitationsListeners)
      {
        if (this.invitationsListeners.size() == 0)
          init();
        if (!(this.invitationsListeners.contains(paramInvitationListener)))
          this.invitationsListeners.add(paramInvitationListener);
        return;
      }
    }

    public void connectionClosed()
    {
      cancel();
    }

    public void connectionClosedOnError(Exception paramException)
    {
    }

    public void reconnectingIn(int paramInt)
    {
    }

    public void reconnectionFailed(Exception paramException)
    {
    }

    public void reconnectionSuccessful()
    {
    }

    public void removeInvitationListener(InvitationListener paramInvitationListener)
    {
      synchronized (this.invitationsListeners)
      {
        if (this.invitationsListeners.contains(paramInvitationListener))
          this.invitationsListeners.remove(paramInvitationListener);
        if (this.invitationsListeners.size() == 0)
          cancel();
        return;
      }
    }
  }
}